import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AdmCarReimburseVO, AdmCarReimburseForm, AdmCarReimburseQuery } from '@/api/general/administration/car/reimburse/types';

/**
 * 查询车辆报销列表
 * @param query
 * @returns {*}
 */

export const listAdmCarReimburse = (query?: AdmCarReimburseQuery): AxiosPromise<AdmCarReimburseVO[]> => {
  return request({
    url: '/system/admCarReimburse/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询车辆报销详细
 * @param id
 */
export const getAdmCarReimburse = (id: string | number): AxiosPromise<AdmCarReimburseVO> => {
  return request({
    url: '/system/admCarReimburse/' + id,
    method: 'get'
  });
};

/**
 * 新增车辆报销
 * @param data
 */
export const addAdmCarReimburse = (data: AdmCarReimburseForm) => {
  return request({
    url: '/system/admCarReimburse',
    method: 'post',
    data: data
  });
};

/**
 * 修改车辆报销
 * @param data
 */
export const updateAdmCarReimburse = (data: AdmCarReimburseForm) => {
  return request({
    url: '/system/admCarReimburse',
    method: 'put',
    data: data
  });
};

/**
 * 删除车辆报销
 * @param id
 */
export const delAdmCarReimburse = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/admCarReimburse/' + id,
    method: 'delete'
  });
};

/**
 * 获取可报销流程信息
 * @param id
 */
export const getListByUser = (id: string | number | Array<string | number>) => {
  return request({
    url: `/system/admCarReimburse/queryListByUser/${id}`,
    method: 'get',
  });
};


